<div class="clear"></div>
<h2 class="headBox"><i class="fa fa-truck"></i> <?php echo $order->DINO?></h2>
<div class="docHeader">
	

	
	<div class="form-group">
	
	<label for="CustName" class="col-sm-2 control-label">
		<i class="fa fa-user"></i> 
		ชื่อลูกค้า</label>
    <div class="col-sm-10">
     <span style="line-height:20px"><?php echo $order->CustName?></span>
    </div>
   </div>
   <div class="form-group">
	
	<label for="CustName" class="col-sm-2 control-label">
		<i class="fa fa-list"></i> 
		เลขที่ Order</label>
    <div class="col-sm-10">
     <span style="line-height:20px"><a href="<?php echo $current?>viewOrder/?orderid=<?php echo $order->RefNo?>"><?php echo $order->RefNo?> <i class="fa fa-sign-out"></i> </a></span>
    </div>
   </div>
   
    <div class="form-group">
	
	<label for="CustName" class="col-sm-2 control-label">
		<i class="fa fa-calendar"></i> 
		วันที่สร้าง</label>
    <div class="col-sm-10">
     <span style="line-height:20px"><?php echo date("Y-m-d",strtotime($order->CreateOn))?></span>
    </div>
   </div>
   

   
   
   
   
   
   
   <div class="form-group">
	
	<label for="CustName" class="col-sm-2 control-label">
		<i class="fa fa-info-circle"></i> 
		สถานะ DI</label>
    <div class="col-sm-10">
     <span style="line-height:20px"><?php echo $order->DIStatus?></span>
    </div>
   </div>
   <div class="form-group">
	
	<label for="CustName" class="col-sm-2 control-label">
		<i class="fa fa-truck"></i> 
		สถานะการจัดส่ง</label>
    <div class="col-sm-10">
     <span style="line-height:20px"><?php echo $order->SendStatus?></span>
    </div>
   </div>
   
    <div class="form-group">
	
	<label for="CustName" class="col-sm-2 control-label">
		<i class="fa fa-money"></i> 
		สถานะการชำระเงิน</label>
    <div class="col-sm-10">
     <span style="line-height:20px"><?php echo $order->PaymentStatus?></span>
    </div>
   </div>
   
   <div class="form-group">
	
	<label for="CustName" class="col-sm-2 control-label">
		<i class="fa fa-truck"></i> 
		วันที่จัดส่ง</label>
    <div class="col-sm-10">
     <span style="line-height:20px"><?php echo $order->ShipDate?></span>
    </div>
   </div>
  
</div>

<?

if(count($order->orderDetail) > 0 ){
?>
<table cellpadding="6" cellspacing="1"  border="0" class="myTable table2">

<tr>
  <th style="width:40%">สินค้า</th>
  
  
  <th style="text-align:right;width:10%">จำนวนจัดส่ง</th>
  <th style="text-align:right;width:10%">ราคารวม</th>
  
  
</tr>

<?php $i = 1; ?>
<?
$allDiscount = 0;
$totalSale = 0;
$totalPremium = 0;
?>
<?php foreach ($order->orderDetail as $in=>$val): ?>
	
	<?
	$pName = $val->pName;
	$class = "";
	if($val->IsSaleProduct == "TANN"){
		$class = "line-preimum";
		$pName = $pName."<br>(สินค้าแถม)";	
	}
	
	?>
	<tr class="<?php echo $class?>">
	  <td style="width:40%"><?php echo $val->pID ?><br />
		<?php echo $pName;//$val->pName ?></td>
	
	 
		
		
	  
		<td style="width:10%;text-align: right;"><?php echo converUnitView($val)?></td>
	  <td style="text-align:right;width:90px">
	  	<div style="width:90px;float:right;"><?php echo $this->cart->format_number($val->LineAmount); ?></div>
	  </td>
	  
	  
	  
	  
	</tr>

<?php $i++; ?>

<?php endforeach; ?>

<tr>
  <td colspan="1"> </td>
  <td class="right"><strong>ราคารวม</strong></td>
  
  <td class="right" style="text-align: right"><?php echo $this->cart->format_number($order->TotalAmount); ?></td>
</tr>

<tr>
  <td colspan="1"> </td>
  <td class="right"><strong>ส่วนลด</strong></td>
  <td class="right" style="text-align: right"><?php echo $this->cart->format_number($order->Discount); ?></td>
</tr>
<tr>
  <td colspan="1"> </td>
  <td class="right"><strong>สุทธิ</strong></td>
  <td class="right" style="text-align: right"><?php echo $this->cart->format_number($order->NetAmount); ?></td>
</tr>
</table>
<?
}
?>
